package main

import (
	"fmt"
	"time"
)

func main() {
	/*
		// 顺序打印
		Printer("hello")
		Printer("world")*/
	//runtime.GOMAXPROCS(1)

	go Printer("hello")
	go Printer("world")

	for {

	}
}

// 定义一个打印机，参数为自复查UN个，按每个字符打印
func Printer(str string) {
	for _, data := range str {
		fmt.Printf("%c", data)
		time.Sleep(time.Second)
	}
	fmt.Println()
}
